;(function(window){
	window.ShellSort = {
		sort: function(pDatas){
			this._datas = pDatas;
			var ln = this._datas.length,
				gap = 1;
			if( ln>5 )
				while( gap<this._datas.length/3 )
					gap = gap*3+1;
			while(gap > 0){
				for(var i= 0; i<ln; i++){
					var j = i;
					var tmp = this._datas[j];
					while(j>gap-1 && this._datas[j-gap] >= tmp){
						this._datas[j] = this._datas[j-gap];
						j -= gap;
					}
					this._datas[j] = tmp;
				}
				gap = Math.floor((gap-1)/3);
			}
		}
	};
})(window);